package com.example.springboot.service.impl;

import com.example.springboot.dao.RoleDao;
import com.example.springboot.entity.Role;
import com.example.springboot.service.RoleService;

/**
 * Created by tang on 2018/1/5.
 */
public class RoleServiceImpl implements RoleService {
    private RoleDao roleDao = new RoleDao();

    @Override
    public Role createRole(Role role) {
        role = roleDao.createRole(role);
        return role;
    }

    @Override
    public void deleteRole(Long roleId) {
        roleDao.deleteRole(roleId);
    }

    @Override
    public void correlationPermissions(Long roleId, Long... permissionIds) {
        roleDao.correlationPermissions(roleId, permissionIds);
    }

    @Override
    public void uncorrelationPermissions(Long roleId, Long... permissionIds) {
        roleDao.correlationPermissions(roleId, permissionIds);
    }
}
